package com.szh.mysobproject.viewmodel.app

import com.szh.mysobproject.http.ServiceCreator
import com.szh.mysobproject.http.request.api.UserApi
import com.szh.mysobproject.http.model.User

/**
 * @author : create by  szh
 * @date : 2022/6/17 17:20
 * @desc :用户信息获取
 */

object UserNetwork {

    private val userApi = ServiceCreator.create<UserApi>()

    suspend fun queryUserAvatar(account: String) = userApi.queryUserAvatar(account)
    suspend fun login(captcha:String,user: User) = userApi.login(captcha, user)
    suspend fun logout() = userApi.logout()

    suspend fun checkAllowance() = userApi.checkAllowance()
    suspend fun getAllowance() = userApi.getAllowance()
    suspend fun queryUserInfo() = userApi.queryUserInfo()




    suspend fun checkToken() = userApi.checkToken()

    suspend fun getVipUserList() = userApi.getVipUserList()
    suspend fun getAchievement() = userApi.getAchievement()
    suspend fun getAchievement(userId: String) = userApi.getAchievement(userId)

    suspend fun getUserInfo(userId: String) = userApi.getUserInfo(userId)
    suspend fun followState(userId: String) = userApi.followState(userId)
    suspend fun followUser(userId: String) = userApi.followUser(userId)
    suspend fun unFollowUser(userId: String) = userApi.unFollowUser(userId)

    suspend fun getRichList(count :Int = 100) =  userApi.getRichList(count)
}